import Vue from 'vue'
import Vuex from 'vuex'
import createLogger from 'vuex/dist/logger'

import user from './modules/user'
import list from './modules/entitylist'
import relatedTable from './modules/relatedTable'
import buttonInfo from './modules/buttonStatus'
import filters from './modules/list-filter'
import entityedit from './modules/entityedit'
import relatedModal from './modules/relatedModal'
import CusDatePicker from './modules/cusDatePicker'
Vue.use(Vuex)

const debug = process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'production-runtime'

const store = new Vuex.Store({
  modules: {
    user,
    filters,
    list,
    relatedTable,
    buttonInfo,
    entityedit,
    relatedModal,
    CusDatePicker
  },
  strict: debug,
  plugins: debug ? [createLogger()] : []
})

export default store
